package com.woniu.cq.medical.dao.mymapper;

import com.woniu.cq.medical.controller.form.ActInfoForm;
import com.woniu.cq.medical.dao.ActOrderInfoMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.context.annotation.Primary;

import java.util.List;

@Primary
public interface My_ActOrderInfoMapper extends ActOrderInfoMapper {
    @Select("select a.act_order_info_id,a.act_order_id,p.patient_name,\n" +
            "p.patient_age,p.patient_sex,c.case_id,\n" +
            "a.act_order_type,a.act_order_start_time,a.act_order_end_time,\n" +
            "a.act_order_result,d.doctor_name from lonbon_patient p left join \n" +
            "lonbon_case c on p.patient_id=c.user_id left join lonbon_act_order_info a\n" +
            "on c.case_id=a.case_id left join lonbon_doctor d on a.doctor_id=d.doctor_id\n" +
            "where p.patient_id_card=#{patientIdCard} and c.case_id=#{caseId}")
    List<ActInfoForm> selectPatientByIdCard(@Param("patientIdCard") String patientIdCard,@Param("caseId") String caseId);

    @Select("select a.act_order_info_id,a.act_order_id,p.patient_name,\n" +
            "p.patient_age,p.patient_sex,c.case_id,\n" +
            "a.act_order_type,a.act_order_start_time,a.act_order_end_time,\n" +
            "a.act_order_result,d.doctor_name from lonbon_patient p left join \n" +
            "lonbon_case c on p.patient_id=c.user_id left join lonbon_act_order_info a\n" +
            "on c.case_id=a.case_id left join lonbon_doctor d on a.doctor_id=d.doctor_id\n" +
            "where p.patient_id_card=#{patientIdCard}")
    List<ActInfoForm> selectPatientByIdCard1(String patientIdCard);
}
